/*
*	FILE			common.h
*	DESCRIPTION		shared defines
*	AUTHOR			J.Zhao
*	DATE			12/15/2010
*/

#ifndef __BAZINGA4_KOOTHRAPPALI_COMMON_H__
#define __BAZINGA4_KOOTHRAPPALI_COMMON_H__


#define BAZINGA4_KOOTHRAPPALI_NS_BEGIN	namespace BAZINGA4 {	\
										namespace KOOTHRAPPALI {		
#define BAZINGA4_KOOTHRAPPALI_NS_END	}	}
#define	USE_BAZINGA4_KOOTHRAPPALI_NS	using namespace BAZINGA4::KOOTHRAPPALI;



/**
*	macro for platform portable
*	BAZINGA4_API :  for windows export symbols from dll.
*	BAZINGA4_CALL: using __stdcall when invoke interface.
*	BAZINGA4_CC:     i forget the reason :( maybe it's for supporting borland compiler.
*/

#if defined(WINDOWS_OS)

#	if defined(DLL_EXPORT)
#		define BAZINGA4_API __declspec(dllexport)
#	else 
#		define BAZINGA4_API __declspec(dllimport)
#	endif 

#	define BAZINGA4_CALL __stdcall

#	if defined(MSVC)
#		define BAZINGA4_CC __cdecl
#	endif

	typedef __int64 BAZINGA4_INT64;

#elif defined(LINUX_OS)

#	define BAZINGA4_API
#	define BAZINGA4_CALL __attribute__((stdcall))
#	define BAZINGA4_CC

	typedef long long int BAZINGA4_INT64;

// others
#else

#	define BAZINGA4_API
#	define BAZINGA4_CALL
#	define BAZINGA4_CC
#endif

#define SAFEDELETE(ptr)  do { delete ptr; ptr= NULL; } while(0);
#define SAFEDELETEARY(ptr) do { delete [] ptr; ptr = NULL;} while(0);



#endif /* __BAZINGA4_KOOTHRAPPALI_COMMON_H__ */